/*
 * FavoritesItem.hpp
 *
 *  Created on: 2014年10月11日
 *      Author: Administrator
 */

#ifndef FAVORITESITEM_HPP_
#define FAVORITESITEM_HPP_

#include <QObject>

class FavoritesItem: public QObject
{
    Q_OBJECT

    // These are the properties that will be accessible by the datamodel in the view.
    Q_PROPERTY(QString id READ id WRITE setId NOTIFY idChanged FINAL)
    Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL)
    Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged FINAL)
    Q_PROPERTY(QString content READ content WRITE setContent NOTIFY contentChanged FINAL)

public:
    FavoritesItem();
    FavoritesItem(const QString &id, const QString &title, const QString &url, const QString &content);

    QString id() const;
    QString title() const;
    QString url() const;
    QString content() const;

    void setId(const QString &newId);
    void setTitle(const QString &newTitle);
    void setUrl(const QString &newUrl);
    void setContent(const QString &newContent);

Q_SIGNALS:
    void idChanged(const QString &newId);
    void titleChanged(const QString &title);
    void urlChanged(const QString &url);
    void contentChanged(const QString &content);

private:
    QString m_id;
    QString m_title;
    QString m_url;
    QString m_content;
};

#endif /* FAVORITESITEM_HPP_ */
